\(\int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx\) [213]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 31, antiderivative size = 73 \[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=-\frac {\sqrt {-1+x^4} \arcsin (x)}{\sqrt {1-x^2} \sqrt {1+x^2}}+\frac {\sqrt {-1+x^2} \sqrt {-1+x^4} \text {arcsinh}(x)}{\left (1-x^2\right ) \sqrt {1+x^2}} \]

[Out]

-arcsin(x)*(x^4-1)^(1/2)/(-x^2+1)^(1/2)/(x^2+1)^(1/2)+arcsinh(x)*(x^2-1)^(1/2)*(x^4-1)^(1/2)/(-x^2+1)/(x^2+1)^
(1/2)

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {6874, 1166, 221, 223, 212} \[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\frac {\sqrt {x^2-1} \sqrt {x^2+1} \text {arctanh}\left (\frac {x}{\sqrt {x^2-1}}\right )}{\sqrt {x^4-1}}-\frac {\sqrt {x^2-1} \sqrt {x^2+1} \text {arcsinh}(x)}{\sqrt {x^4-1}} \]

[In]

Int[(-Sqrt[-1 + x^2] + Sqrt[1 + x^2])/Sqrt[-1 + x^4],x]

[Out]

-((Sqrt[-1 + x^2]*Sqrt[1 + x^2]*ArcSinh[x])/Sqrt[-1 + x^4]) + (Sqrt[-1 + x^2]*Sqrt[1 + x^2]*ArcTanh[x/Sqrt[-1
+ x^2]])/Sqrt[-1 + x^4]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 1166

Int[((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (c_.)*(x_)^4)^(p_), x_Symbol] :> Dist[(a + c*x^4)^FracPart[p]/((d + e*x
^2)^FracPart[p]*(a/d + c*(x^2/e))^FracPart[p]), Int[(d + e*x^2)^(p + q)*(a/d + (c/e)*x^2)^p, x], x] /; FreeQ[{
a, c, d, e, p, q}, x] && EqQ[c*d^2 + a*e^2, 0] &&  !IntegerQ[p]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {\sqrt {-1+x^2}}{\sqrt {-1+x^4}}+\frac {\sqrt {1+x^2}}{\sqrt {-1+x^4}}\right ) \, dx \\ & = -\int \frac {\sqrt {-1+x^2}}{\sqrt {-1+x^4}} \, dx+\int \frac {\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx \\ & = \frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {-1+x^2}} \, dx}{\sqrt {-1+x^4}}-\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \int \frac {1}{\sqrt {1+x^2}} \, dx}{\sqrt {-1+x^4}} \\ & = -\frac {\sqrt {-1+x^2} \sqrt {1+x^2} \sinh ^{-1}(x)}{\sqrt {-1+x^4}}+\frac {\left (\sqrt {-1+x^2} \sqrt {1+x^2}\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^4}} \\ & = -\frac {\sqrt {-1+x^2} \sqrt {1+x^2} \sinh ^{-1}(x)}{\sqrt {-1+x^4}}+\frac {\sqrt {-1+x^2} \sqrt {1+x^2} \tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^4}} \\ \end{align*}

Mathematica [A] (verified)

Time = 3.61 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.97 \[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\log \left (1-x^2\right )-\log \left (1+x^2\right )-\log \left (-x+x^3+\sqrt {-1+x^2} \sqrt {-1+x^4}\right )+\log \left (x+x^3+\sqrt {1+x^2} \sqrt {-1+x^4}\right ) \]

[In]

Integrate[(-Sqrt[-1 + x^2] + Sqrt[1 + x^2])/Sqrt[-1 + x^4],x]

[Out]

Log[1 - x^2] - Log[1 + x^2] - Log[-x + x^3 + Sqrt[-1 + x^2]*Sqrt[-1 + x^4]] + Log[x + x^3 + Sqrt[1 + x^2]*Sqrt
[-1 + x^4]]

Maple [A] (verified)

Time = 0.25 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.81

method result size
default \(-\frac {\sqrt {x^{4}-1}\, \operatorname {arcsinh}\left (x \right )}{\sqrt {x^{2}-1}\, \sqrt {x^{2}+1}}+\frac {\sqrt {x^{4}-1}\, \ln \left (x +\sqrt {x^{2}-1}\right )}{\sqrt {x^{2}+1}\, \sqrt {x^{2}-1}}\) \(59\)

[In]

int((-(x^2-1)^(1/2)+(x^2+1)^(1/2))/(x^4-1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/(x^2-1)^(1/2)*(x^4-1)^(1/2)/(x^2+1)^(1/2)*arcsinh(x)+1/(x^2+1)^(1/2)*(x^4-1)^(1/2)/(x^2-1)^(1/2)*ln(x+(x^2-
1)^(1/2))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 137 vs. \(2 (53) = 106\).

Time = 0.25 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.88 \[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\frac {1}{2} \, \log \left (\frac {x^{3} + \sqrt {x^{4} - 1} \sqrt {x^{2} + 1} + x}{x^{3} + x}\right ) - \frac {1}{2} \, \log \left (-\frac {x^{3} - \sqrt {x^{4} - 1} \sqrt {x^{2} + 1} + x}{x^{3} + x}\right ) - \frac {1}{2} \, \log \left (\frac {x^{3} + \sqrt {x^{4} - 1} \sqrt {x^{2} - 1} - x}{x^{3} - x}\right ) + \frac {1}{2} \, \log \left (-\frac {x^{3} - \sqrt {x^{4} - 1} \sqrt {x^{2} - 1} - x}{x^{3} - x}\right ) \]

[In]

integrate((-(x^2-1)^(1/2)+(x^2+1)^(1/2))/(x^4-1)^(1/2),x, algorithm="fricas")

[Out]

1/2*log((x^3 + sqrt(x^4 - 1)*sqrt(x^2 + 1) + x)/(x^3 + x)) - 1/2*log(-(x^3 - sqrt(x^4 - 1)*sqrt(x^2 + 1) + x)/
(x^3 + x)) - 1/2*log((x^3 + sqrt(x^4 - 1)*sqrt(x^2 - 1) - x)/(x^3 - x)) + 1/2*log(-(x^3 - sqrt(x^4 - 1)*sqrt(x
^2 - 1) - x)/(x^3 - x))

Sympy [F]

\[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\int \frac {- \sqrt {x^{2} - 1} + \sqrt {x^{2} + 1}}{\sqrt {\left (x - 1\right ) \left (x + 1\right ) \left (x^{2} + 1\right )}}\, dx \]

[In]

integrate((-(x**2-1)**(1/2)+(x**2+1)**(1/2))/(x**4-1)**(1/2),x)

[Out]

Integral((-sqrt(x**2 - 1) + sqrt(x**2 + 1))/sqrt((x - 1)*(x + 1)*(x**2 + 1)), x)

Maxima [F]

\[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\int { \frac {\sqrt {x^{2} + 1} - \sqrt {x^{2} - 1}}{\sqrt {x^{4} - 1}} \,d x } \]

[In]

integrate((-(x^2-1)^(1/2)+(x^2+1)^(1/2))/(x^4-1)^(1/2),x, algorithm="maxima")

[Out]

integrate((sqrt(x^2 + 1) - sqrt(x^2 - 1))/sqrt(x^4 - 1), x)

Giac [F]

\[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\int { \frac {\sqrt {x^{2} + 1} - \sqrt {x^{2} - 1}}{\sqrt {x^{4} - 1}} \,d x } \]

[In]

integrate((-(x^2-1)^(1/2)+(x^2+1)^(1/2))/(x^4-1)^(1/2),x, algorithm="giac")

[Out]

integrate((sqrt(x^2 + 1) - sqrt(x^2 - 1))/sqrt(x^4 - 1), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {-\sqrt {-1+x^2}+\sqrt {1+x^2}}{\sqrt {-1+x^4}} \, dx=\int -\frac {\sqrt {x^2-1}-\sqrt {x^2+1}}{\sqrt {x^4-1}} \,d x \]

[In]

int(-((x^2 - 1)^(1/2) - (x^2 + 1)^(1/2))/(x^4 - 1)^(1/2),x)

[Out]

int(-((x^2 - 1)^(1/2) - (x^2 + 1)^(1/2))/(x^4 - 1)^(1/2), x)